import {request} from "@/network/request";

//获取搜索房间信息
export function getAllRoom(current,size,type,data){
    return request({
        url: '/admin/room/list',
        method: 'get',
        params:{current,size,type,data}
    })
}
//获取所有可用房间的编号
export function getFreeRoomIdsForRoomTypeId(roomTypeId){
    return request({
        url: '/admin/room/getFreeRoomIdsForRoomTypeId',
        method: 'get',
        params:{roomTypeId}
    })
}
//添加房间 包括图片数据
export function addRoom(roomInfo){
    return request({
        url: '/admin/room/add',
        method: 'post',
        data: roomInfo
    })
}
//修改房间信息 包括图片数据
export function updateRoom(roomInfo){
    return request({
        url: '/admin/room/update',
        method: 'post',
        data: roomInfo,
    })
}
//批量操作房间  下架 删除 等
export function batchHandleRoom(type,data){
    return request({
        url: '/admin/room/batch/'+type,
        method: 'post',
        data:data,
    })
}
//获取所有楼层
export function getAllFloor(){
    return request({
        url: '/admin/room/floorList',
        method: 'get',
    })
}
//根据订单的orderRoomNo获取房间数据
export function getRoomByOrderRoomNo(roomNo){
    return request({
        url: '/admin/room/getRoomByOrderRoomNo/'+roomNo,
        method: 'get'
    })
}

///////////////////////////////////room type
//在用户下单的时候获取用户下单房间的数据
export function getRoomTypeByIdAndTypeNo(data){
    return request({
        url: '/admin/roomType/getRoomTypeByIdAndTypeNo',
        method: 'get',
        params:data
    })
}
//获取所有的房间类型 id, 名称-床型
export function getRoomTypeAndBed(){
    return request({
        url: '/admin/roomType/getRoomTypeAndBed',
        method: 'get',
    })
}
//
export function getRoomTypeForRoomTypeId(roomTypeId){
    return request({
        url: '/admin/roomType/getRoomTypeForRoomTypeId',
        method: 'get',
        params: {roomTypeId}
    })
}

//根据房间 的房间类型id 获取房间类型 房间页面查看房间类型数据
export function getRoomTypeByRoomId(roomId){
    return request({
        url: '/admin/roomType/getRoomTypeByRoomId/'+roomId,
        method: 'get',
    })
}
export function getSelectDataForRoomType(){
    return request({
        url: '/admin/roomType/getSelectDataForRoomType',
        method: 'get',
    })
}